import service from '@/utils/request'
const BASE_URL = 'api-system'
//获取banner列表
export function listBanner(data) {
    return service({
        url: `${BASE_URL}/banners`,
        method: 'get',
        params: data
    })
}

// 保存banner
export function saveBanner(data) {
    return service({
        url: `${BASE_URL}/banner`,
        method: 'post',
        data
    })
}

// 修改banner
export function updateBanner(data) {
    return service({
        url: `${BASE_URL}/banner`,
        method: 'put',
        data
    })
}

//banner详情
export function getBanner(bannerId) {
    return service({
        url: `${BASE_URL}/banner/${bannerId}`,
        method: 'get'
    })
}

//删除banner
export function deleteBanner(bannerId) {
    return service({
        url: `${BASE_URL}/banner/${bannerId}`,
        method: 'delete'
    })
}

//修改banner状态
export function updateBannerStatus(bannerId,status) {
    return service({
        url: `${BASE_URL}/banner/${bannerId}/status/${status}`,
        method: 'put'
    })
}
